/**
 * Copyright 2012 Evernote Corporation.
 */
require
    .config({
      baseUrl : "/redesign/global/js",
      deps : [ 'common', 'header' ],
      paths : {
        /* In Alphabetical Order */
        "billing" : "evernoteClient/Billing",
        "businessEmailInviteBox" : "businessEmailInviteBox",
        "checkout" : "evernoteClient/Checkout",
        "common" : "common",
        "contacts-autocomplete" : "evernoteClient/Contacts.autocomplete",
        "customize-sponsor" : "evernoteClient/customize_sponsor",
        "dataTableRequest" : "evernoteClient/JQueryDataTableRequest",
        "dataTableResponse" : "evernoteClient/JQueryDataTableResponse",
        "domReady" : "requirePlugins/domReady.min",
        "email-parser" : "email-parser/email-parser",
        "first-launch" : "first-launch",
        "flash-detect" : "flash_detect_min",
        "googleConnect" : "googleConnect",
        "i18n" : "evernoteClient/i18n2",
        "imageGallery" : "imageGallery",
        "jquery" : "jquery-1.8.0.min",
        "jquery-autoresize" : "jquery/autoresize.jquery.min",
        "jquery-ui" : "jquery/ui/jquery-ui-1.8.23.custom.min",
        "jquery-form" : "jquery/jquery.form",
        "jquery-serializeObject" : "jquery/jquery.serializeObject",
        "jqueryENDatatables" : "jquery.evernote_dataTables.min",
        "json2" : "json2/json2.min",
        "jsonrpc" : "jsonrpc-1.3.1/jsonrpc-min",
        "lightbox" : "lightbox",
        "linkedNotebooksHelper" : "linked-notebooks",
        "lozenge" : "lozenge/lozenge",
        "manageSponsor" : "evernoteClient/manageSponsorUsers2",
        "parse-util" : "email-parser/parse-util",
        "password-strength" : "password-strength",
        "responsiveTables" : "responsiveTables/responsive-tables",
        "simpledateformat" : "simpledateformat",
        "sponsorCheckout" : "evernoteClient/SponsorCheckout",
        "sponsor-uri-check" : "evernoteClient/sponsor_uri_check",
        "templates" : "icanhaz",
        "text" : "requirePlugins/text.min",
        "textext" : "textExt_1.3.0",
        "tsort" : "tinysort_1.3.27.min",
        "underscore" : "underscore-min",
        "zero-clipboard" : "zeroClipboard/ZeroClipboard"
      },
      /*
       * Legacy libraries that have dependencies but don't define them through
       * require go here
       */
      shim : {
        "billing" : [ 'jquery' ],
        "checkout" : [ 'jquery' ],
        "customize-sponsor" : [ 'jquery' ],
        "dataTableRequest" : [ 'jquery' ],
        "dataTableResponse" : [ 'jquery' ],
        "email-parser" : {
          exports : function() {
            return this.emailParser;
          }
        },
        "flash-detect" : {
          exports : function() {
            return this.FlashDetect;
          }
        },

        "jquery-autoresize" : [ 'jquery' ],
        "jquery-ui" : [ 'jquery' ],
        "jquery-form" : [ 'jquery' ],
        "jquery-serializeObject" : [ 'jquery' ],
        "jqueryENDatatables" : [ 'jquery', 'dataTableRequest',
            'dataTableResponse' ],
        "password-strength" : [ 'jquery' ],
        "sponsorCheckout" : [ 'jquery' ],
        "sponsor-uri-check" : [ 'jquery' ],
        "textext" : [ 'jquery', 'json2' ],
        "tsort" : [ 'jquery' ],

        "zero-clipboard" : {
          exports : function() {
            this.ZeroClipboard
                .setMoviePath("/redesign/global/js/zeroClipboard/ZeroClipboard.swf");
            return this.ZeroClipboard;
          }
        }
      },
      waitSeconds : 60
    // domReady sometimes times out if page load is exceptionally long (e.g. in
    // the webclient).
    });

/* Define reference to Evernote object for legacy libraries. */
var Evernote;

if (!Evernote) {
  Evernote = {};
}
